Skip to content

Conversation

@gagantrivedi
Copy link
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Adds REDIS_CLUSTER_READ_FROM_REPLICAS setting (default: True) to enable reading from Redis Cluster replica nodes.

This improves performance with ElastiCache Serverless by utilizing the reader endpoint on port 6380, distributing read traffic to replica nodes for better scalability and lower latency.

AWS best practices recommend this approach:

Read from replicas – If you are using ElastiCache serverless or have provisioned read replicas (node-based clusters), direct reads to replicas to achieve better scalability and/or lower latency. Reads from replicas are eventually consistent with the primary.

Ref: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/WorkingWithRedis.html

How did you test this code?

  • Unit tests added and passing
  • Verified env.bool() correctly parses the environment variable
  • Verified the setting is passed through to RedisCluster client via read_from_replicas kwarg

Add REDIS_CLUSTER_READ_FROM_REPLICAS setting (default: True) to distribute
read traffic to replica nodes. This improves performance with ElastiCache
Serverless by utilizing the reader endpoint on port 6380.

AWS best practices recommend reading from replicas for better scalability
and lower latency. Reads from replicas are eventually consistent with the
primary.

Ref: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/WorkingWithRedis.html
@gagantrivedi gagantrivedi requested a review from a team as a code owner January 9, 2026 10:19
@gagantrivedi gagantrivedi requested review from khvn26 and removed request for a team January 9, 2026 10:19
@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Review Updated (UTC)
docs Ignored Ignored Jan 9, 2026 10:19am
flagsmith-frontend-preview Ignored Ignored Jan 9, 2026 10:19am
flagsmith-frontend-staging Ignored Ignored Jan 9, 2026 10:19am

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jan 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6506 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-6506 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-e2e:pr-6506 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-6506 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6506 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6506 Finished ✅ Results

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.08%. Comparing base (cb049bf) to head (70d4b77).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6506   +/-   ##
=======================================
  Coverage   98.08%   98.08%           
=======================================
  Files        1296     1296           
  Lines       46616    46620    +4     
=======================================
+ Hits        45724    45728    +4     
  Misses        892      892           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gagantrivedi gagantrivedi merged commit b53e0cf into main Jan 9, 2026
30 checks passed
@gagantrivedi gagantrivedi deleted the feat/redis-read-from-replicas branch January 9, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants